package com_djm_2025_05_25;

public class Test {

    public static void swap(Myvalue myvalue1, Myvalue myvalue2) {
        int tmp = myvalue1.value;
        myvalue1.value = myvalue2.value;
        myvalue2.value = tmp;
    }

    public static void main(String[] args) {
        Myvalue myvalue1 = new Myvalue();
        myvalue1.value = 10;
        Myvalue myvalue2 = new Myvalue();
        myvalue2.value = 20;

        System.out.println("交换之前"+"myvalue1:"+myvalue1.toString()+"myvalue2:"+myvalue2.toString());
        Test.swap(myvalue1,myvalue2);
        System.out.println("交换之后"+"myvalue1:"+myvalue1.toString()+"myvalue2:"+myvalue2.toString());

    }
}
